package com.choichumgming.rentcat.service;

import com.choichumgming.rentcat.common.api.CommonResult;
import com.choichumgming.rentcat.model.PmsProduct;
import com.choichumgming.rentcat.service.impl.PmsProductFeignApiHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ClassName PmsProductFeignApi
 * @Description : pms服务暴露的api接口服务
 *
 * @Author : choichumgming
 * @Date : 27/2/2020 21:46
*/

@FeignClient(value = "rentcat-provider-pms", fallback = PmsProductFeignApiHystrix.class)
public interface PmsProductFeignApi {


    /**
     * @Description : 根据id获得商品详情
     *
     * @Return :
     * @Author : choichumgming
     * @Date : 5/3/2020 00:13
    */
    @RequestMapping(value = "/api/product")
    CommonResult<PmsProduct> getProduct(@RequestParam("productId")Long productId);


    /**
     * @Description : 释放被锁住的商品
     *
     * @param productId
     * @Return : com.choichumgming.rentcat.common.api.CommonResult
     * @Author : choichumgming
     * @Date : 5/3/2020 21:12
    */

    @RequestMapping(value = "/api/releaseRentLock")
    CommonResult releaseRentLock(@RequestParam("productId")Long productId);

     /**
     * @Description : 锁住的商品
     *
     * @param productId
     * @Return : com.choichumgming.rentcat.common.api.CommonResult
     * @Author : choichumgming
     * @Date : 5/3/2020 21:12
    */

    @RequestMapping(value = "/api/lockProduct")
    CommonResult lockProduct(@RequestParam("productId")Long productId);


}
